package web

import (
	"ksd-social-api/commons/base/controller"
)

/**
 * 用户
 * @author feige
 * @date 2023-11-23
 * @version 1.0
 * @desc
 */
type UserCenterZoneController struct {
	controller.BaseController
}

/**
 * 查询用户中心首页总览的数据信息
 * @author feige
 * @date 2024-01-08
 * @version 1.0
 * @desc
 */
func (web *UserCenterZoneController) GetUserInfoByUuid() {
	userUuid := web.GetString("uuid")
	if len(userUuid) == 0 {
		web.FailCodeMsg(701, "请输入用户唯一标识")
		return
	}

	systemId := web.GetSystemId()
	userVo := userService.GetUserInfoByUuid(userUuid, systemId)
	if userVo == nil {
		web.FailCodeMsg(701, "非常抱歉，找不到此用户！")
		return
	}

	if userVo != nil && userVo.Forbidden == 1 {
		web.FailCodeMsg(701, "你被管理员关进了小黑屋！")
		return
	}

	// 各模块的统计
	userVo.ZoneCounts = userService.CountUserZoneAll(userVo.Id, systemId)
	web.Ok(userVo)
}
